<?php
/**
 * Created by PhpStorm.
 * User: suruixiang
 * Date: 2017/10/10
 * Time: 下午4:56
 */
namespace app\index\model;

use think\Model;

class UserLoginLog extends Model
{
    /**
     * 记录用户登录日志
     * @param $user_id
     */
    public function writeLog($user_id)
    {
        $this->insert([
            'user_id'    => $user_id,
            'login_ip'   => getIPaddress(),
            'login_time' => time()
        ]);
    }
}